package com.daona.job.flow.component;

import com.daona.job.flow.context.PdfContext;
import com.daona.job.service.PdfService;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@LiteflowComponent
public class PdfReport extends NodeComponent {

    private final PdfService pdfService;

    @Override
    public void process() throws Exception {
        PdfContext context = this.getRequestData();
        pdfService.mergePdf(context.getPdfs(), context.getOutput());
    }
}
